<template>
  <div>
    <div style="font-size: 16px"><span>{{ value.name }}(可选{{ value.selectCount }}): </span></div>
    <el-checkbox-group min=0 :max="value.selectCount" v-model=data @change="handleChange">
      <el-checkbox v-for="option in value.options" :label="option" :key="option">{{ option }}</el-checkbox>
    </el-checkbox-group>
  </div>
</template>

<script>
export default {
  props: {
    value: {
      required: false
    },
    model: {
      required: false
    }
  },
  data () {
    return {
      data: []
    }
  },
  watch: {
    model () {
      this.data = this.model
    }
  },
  methods: {
    handleChange (newValue) {
      this.$emit('update:model', newValue)
    }
  }
}
</script>

<style scoped>

</style>
